package com.cheng.example.book.advise151.chap5.client73;

import lombok.Data;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


@Data
public class Employee implements Comparable<Employee> {
    // 工号--按照进入公司的先后顺序编码的
    private int id;
    // 姓名
    private String name;
    // 职位
    private Position position;

    public Employee(int _id, String _name, Position _position) {
        id = _id;
        name = _name;
        position = _position;
    }
    //getter和setter方法略
    // 按照Id排序，也就是按照资历的深浅排序
    @Override
    public int compareTo(Employee o) {
        return new CompareToBuilder().append(id, o.id).toComparison();
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

}
//枚举类型(三个级别Boss(老板)、经理(Manager)、普通员工(Staff))
enum Position {
    Boss, Manager, Staff
}